/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.src.ptit.javatraining.huynh.btvn1;

import java.util.Scanner;

/**
 *
 * @author user
 */
public class Baitap6 {

    public static int reverse(long a) {
        String s = String.valueOf(a);
        StringBuilder s3 = new StringBuilder(s);
        String s4 = new String(s3.reverse());
        if (s.equals(s4)) {
            return 1;
        }
        return 0;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long m;
        long s1 = (long) Math.pow(10, 5);
        long s2 = (long) Math.pow(10, 6);
        for (m = s1; m < s2; m++) {
            if (reverse(m) == 1) {
                System.out.println(" " + m);
            }
        }
    }
}
